'use strict';

module.exports = app => {
  const { CHAR } = app.Sequelize;

  // 手机
  const Phone = app.model.define('phone', {
    // 手机号
    number: { type: CHAR(11), primaryKey: true },
  });

  Phone.associate = function() {
    // 用户
    Phone.belongsTo(app.model.User);
  };

  return Phone;
};
